MoveUserInHierarchyRequest and MoveUserInHierarchyComplete Example Added by ~Naomi Xanjipychekoden on May 11, 2012 | Version 1
|
The current Lotus Notes designer help file for notesAdministrationProcess.MoveUserInHierarchyRequest and notesAdministrationProcess.MoveUserInHierarchyComplete do not contain example to see how these functions are used. This wiki article will provide one example of how to use them.
|
In order to properly move/rename a user in your environment programmatically, you can use these two function together. First you use MoveUserInHierarchyRequest to create the adminp request, then use MoveUserInHierarchyComplete to process that request and to rename the user if needed. The following code sample is one way to do this.
adminp.Certifierfile = "c:\ids\old-O-cert.id"
adminp.Certifierpassword = "password"
adminp.Usecertificateauthority = False
certstring = "/" + newOU1 + "/" + newO
'must specify new OU
noteid1 = adminp.Moveuserinhierarchyrequest(username.Abbreviated, certstring, False)
'wait to allow time for the request to post in admin4.nsf
Sleep 5
'must specify new certifier file and password
adminp.Certifierfile = "c:\ids\new-OU-cert.id"
adminp.Certifierpassword = "password"
noteid2 = adminp.Moveuserinhierarchycomplete(noteid1) |